package com.wty.basic.collection;

import com.google.common.collect.ArrayListMultimap;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author wangtengyu
 * @Create 2018-08-08-13:25
 */
public class MapDemo {



    @Test
    public void mapDemo(){
        Map<String,String> hashMap=new HashMap<>();
        hashMap.put("wty","kids");
        hashMap.put(null,null);
        hashMap.put(null,"zzzz");
        System.out.println(hashMap.size());
        System.out.println(hashMap.get(null));
    }

    @Test
    public void multiMapDemo(){
        ArrayListMultimap multimap= ArrayListMultimap.create();
        multimap.put("wty","123");
        multimap.put("wty","456");
        multimap.put("wty","789");
        multimap.put("wty","今天");
        multimap.put("wty","天气");
        multimap.put("wty","不错");
        System.out.println(multimap.get("wty"));

    }
}
